package models

type CommentModel struct {
	Model
	Context      string          `gorm:"size:256;comment:评论内容" json:"context"`
	UserID       uint            `gorm:"comment:用户ID" json:"userID"`
	UserModel    UserModel       `gorm:"foreignKey:UserID" json:"-"`
	ArticleID    uint            `gorm:"comment:文章ID" json:"articleID"`
	ArticleModel ArticleModel    `gorm:"foreignKey:ArticleID" json:"-"`
	ParentID     *uint           `gorm:"comment:文章父评论ID" json:"parentID"`
	ParenModel   *CommentModel   `gorm:"foreignKey:ParentID" json:"-"`
	SubComment   []*CommentModel `gorm:"foreignKey:ParentID" json:"-"` //文件子评论ID
	RootParentID *uint           `gorm:"comment:文章评论ID" json:"rootParentID"`
	DiggCount    uint            `gorm:"comment:评论点赞数" json:"digCount"`
}
